import request from '@/axios'

export const getMenuListApi = (title: string) => {
  return request.post({ url: '/api/menu/list', data: { title: title } })
}

export const addMenu = (data) => {
  return request.post({ url: '/api/menu/addMenu', data })
}

export const updateMenu = (data) => {
  return request.post({ url: '/api/menu/updateMenu', data })
}

export const deleteMenu = (menuId: string) => {
  return request.post({ url: '/api/menu/deleteMenu', data: { id: menuId } })
}

export const menuDetail = (menuId: string) => {
  return request.post({ url: '/api/menu/detail', data: { id: menuId } })
}

export const getRouter = () => {
  return request.post({ url: '/api/menu/getRouter' })
}
